---
layout: "default"
title: "withUnsafeMutableBytes"
description: "Swift documentation for 'withUnsafeMutableBytes': Invokes body with an UnsafeMutableRawBufferPointer argument and returns the."
keywords: "withUnsafeMutableBytes,func,swift,documentation"
root: "/v3.0"
---

<div class="declaration" id="func-withunsafemutablebytes-t-result-of_-inout-t_-unsafemutablerawbufferpointer-throws-result">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-withunsafemutablebytes-t-result-of_-inout-t_-unsafemutablerawbufferpointer-throws-result">func withUnsafeMutableBytes&lt;T, Result&gt;(<wbr>of:<wbr> inout T, _: (UnsafeMutableRawBufferPointer) throws -&gt; Result)</a>
        
<div class="comment collapse" id="comment-func-withunsafemutablebytes-t-result-of_-inout-t_-unsafemutablerawbufferpointer-throws-result"><div class="p">
    <p>Invokes <code>body</code> with an <code>UnsafeMutableRawBufferPointer</code> argument and returns the
result.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func withUnsafeMutableBytes&lt;T, Result&gt;(of arg: inout T, _ body: (UnsafeMutableRawBufferPointer) throws -&gt; Result) rethrows -&gt; Result</code>
    
    
</div></div>
</div>
